home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib43 / mntlib / fork.c < prev    next >
C/C++ Source or Header  |  1993-07-06  |  258b  |  24 lines

  1. /* public domain fork() for MiNT */
  2.  
  3. #include <unistd.h>
  4. #include <errno.h>
  5. #include <mintbind.h>
  6.  
  7. int
  8. fork()
  9. {
  10.     int r;
  11.     extern int __mint;
  12.  
  13.     if (__mint == 0)
  14.         r = -EINVAL;
  15.     else
  16.         r = (int)Pfork();
  17.  
  18.     if (r < 0) {
  19.         errno = -r;
  20.         return -1;
  21.     }
  22.     return r;
  23. }
  24.